/*
*** (C) 2008 UCMai.com ***

Subj: 系统配置
Auth: zhouyongtai
Date: 2008-10-07
*/

//定义全局变量
var DLORDER_PAGESIZE = 25;
var USER_PAGESIZE = 25;
var DEPART_PAGESIZE = 25;
var LargePageSize = 100;
var LABS_NUM = 0;

var sysCenterHeight = document.body.clientHeight - 84;
var sysCenterWidth = document.body.clientWidth - 177;

var BRAWWINDOW = false;
var BERRWINDOW = false;
var BOKWINDOW = false;

var SYSFRAMEWORK = [
	[1,'收发管理'],
	[2,'系统管理'],
	[3,'会员管理'],
	[4,'收货订单管理'],
	[5,'销售订单管理'],
	[6,'库存管理'],
	[7,'报价管理'],
	[8,'代练订单管理']
];

var ORDERSTATE_STORE = [
	[0,'处理中'],
	[1,'进行中'],
	[2,'已审核'],
	[3,'已打款'],
	[4,'问题单'],
	[5,'无效单'],
	[6,'已完成'],
	[7,'完成审核']
];

//定义各模块搜索框
var orderstateStore = new Ext.data.SimpleStore({
	fields:[
		{name:'id',type:'int'},
		{name:'name'}
	]
});

orderstateStore.loadData(ORDERSTATE_STORE);

var dlsearchboxForm = new Ext.FormPanel({
	labelAlign:'left',
	bodyStyle:'padding:5px',
	labelWidth:65,
	autoHeight:true,
	border:false,
	labelSeparator:'：',
	items:[
			{
				xtype:'datefield',
				fieldLabel: '&nbsp;开始日期',
				name: 'startdate2',
				id:'startdate',
				anchor:'100%',
				format:'y-m-d'
			},
			{

				xtype:'datefield',
				fieldLabel: '&nbsp;结束日期',
				name: 'enddate',
				id:'enddate',
				anchor:'100%',
				format:'y-m-d'
			},
			{
				xtype:'combo',
				fieldLabel:'&nbsp;定单状态',
				loadingText:'正在读取数据,请稍候...',
				store:orderstateStore,
				displayField:'name',
				valueField:'id',
				id:'comOrderState',
				name:'orderstate',
				hiddenName:'orderstate',
				mode:'local',
				triggerAction:'all',
				emptyText:'',
				anchor:'100%',
				editable:false
			}
	],
	buttons: [{
		id:'btnSearch',
		text:'搜 索',
		disabled:false,
		handler:function(){
			if(dlsearchboxForm.getForm().isValid()){
				//Ext.log(Ext.urlEncode(dlsearchboxForm.getForm().getValues()));
				ImportMod('dlorder.js',function(){
					loadMod({grid:new DlOrderGrid(),title:'代练定单管理',condition:dlsearchboxForm.getForm().getValues()});
				});
			}
		}
	}]
});
var showTips = function(title,url,w,h){

	var winTips = new Ext.Window({
		xtype:'window',
		title: title,
		buttonAlign : 'right',
		closable:true,
		resizable: true,
		layout:'fit',
		width:w,
		height:h,
		closeAction:'hide',
		plain: true,
		items:new Ext.Panel({
			border:false,
			layout:'fit',
			html:'<iframe src="'+ url +'" marginheight="0" marginwidth="0" scrolling="auto" frameborder="0" width="100%" height='+  parseInt(h-80)+'></iframe>'
		}),
		buttons: [{
			text: '关闭',
			handler: function(){
				winTips.hide();
			}.createDelegate(this)
		}]
	});
	winTips.show();
};